package com.dingreading.cloud.soms.service;

import com.dingreading.cloud.soms.entity.BorrowBookLog;
import com.mybatisflex.core.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface BorrowBookLogService extends IService<BorrowBookLog> {

    List<BorrowBookLog> getByBorrowBookId(String storeUid, Long borrowBookId);

    @Transactional(rollbackFor = Exception.class)
    void deleteByBorrowBookIdAndIdsNot(String storeUid, Long borrowBookId, List<Long> ids);

    int updateReturnStatus(String storeUid, Long borrowBookId, Long id, String staffUid, String staffName, Date time);

    Map<Long, Long> getByStoreBookIdBorrowCnt(String storeUid, List<Long> storeBookIdList);

    List<BorrowBookLog> getByStoreUidAndBorrowIds(String storeUid, List<Long> borrowIds);

    Map<Long, Long> deleteBorrowBookCnt(String storeUid, Long borrowBookId, List<Long> logIds);
}
